package com.tvpush.manage.core.service.system.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.tvpush.manage.core.entity.system.SysCity;
import com.tvpush.manage.core.mapper.system.SysCityMapper;
import com.tvpush.manage.core.service.system.SysCityService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author ouyangzn
 * @since 2019-03-24
 */
@Service
public class SysCityServiceImpl extends ServiceImpl<SysCityMapper, SysCity> implements SysCityService {

    @Override
    public Page<SysCity> list(SysCity sysCity) {
        if (StringUtils.isBlank(sysCity.getProvinceId())) {
            return new Page<SysCity>();
        }
        return selectPage(new Page<>(0, Integer.MAX_VALUE), new EntityWrapper<SysCity>().eq(SysCity.PROVINCE_ID, sysCity.getProvinceId()));
    }
}
